package book_management.operation.impl;

import book_management.book.Book;
import book_management.book.BookList;
import book_management.operation.IOperation;

public class RemoveOperation implements IOperation {
    //删除书籍
    @Override
    public void work(BookList bookList) {
        System.out.println("你现在进行的是删除书记操作:");
        System.out.println("请输入要删除书籍名称:");
        String bookName = scanner.next();
        if (bookList.contains(bookName)){
            Book book =bookList.find(bookName);
            bookList.del(book);
            System.out.println("删除成功！");
        }else {
            System.out.println("找不到书籍");
        }
    }
}
